# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=oidentd
pkgver=2.5.0
pkgrel=0
pkgdesc="Configurable IDENT server that supports NAT/IP masq"
url="https://oidentd.janikrabe.com"
arch="all"
license="GPL-2.0-only"
makedepends="bison flex linux-headers libnetfilter_conntrack-dev"
install="$pkgname.pre-install"
subpackages="$pkgname-doc $pkgname-openrc"
source="https://files.janikrabe.com/pub/oidentd/releases/$pkgver/oidentd-$pkgver.tar.xz
	$pkgname.initd
	$pkgname.confd
	"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info
	make
}

package() {
	make DESTDIR="$pkgdir" install

	install -D -m755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -D -m644 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
}

sha512sums="31ff2cad2afaa9f07a0aa35ad904047de78f168f9e6d6a3fcf7397eb89e6b930c30741eb1de44e3c2c24f48ca7d860cafd2771f464b336d400ab6d98384e9320  oidentd-2.5.0.tar.xz
8f4efbd888ab729be6e04197a6f05080a2c5cc3d0c2b6944529f087a9be3a5e4946138aed9c8d74bdce64664e9ba5f2533859e950c6083ce778dac5147cb6a60  oidentd.initd
387acc88fb9331ea57614785abc679dea69401c2d6d266c1481da208d8f9c9d5fb15619aab3871fff51aa5871bd1bd5f55baa7ba9748e8ced97d7d1fbabb1b40  oidentd.confd"
